package com.maxd.controller.wx;


import com.maxd.adapter.IgnoreSecurity;
import com.maxd.error.Result;
import com.maxd.model.LoginInfo;
import com.maxd.service.userinfo.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * app登录
 */
@RestController
@RequestMapping("/appLogin")
@Api(value = "APP登陆", tags = {"APP登陆"})
public class AppLoginController {
    @Autowired
    private IUserService userService;

    @IgnoreSecurity
    @RequestMapping(value = "/loginApp", method = RequestMethod.POST)
    @ApiOperation("用户端使用微信登录")
    public Result loginApp(@RequestBody LoginInfo loginInfo) {
        return userService.loginApp(loginInfo);
    }

    @IgnoreSecurity
    @RequestMapping(value = "/loginWeiXinApp", method = RequestMethod.POST)
    @ApiOperation("用户端微信登录绑定手机号")
    public Result loginWeiXinApp(@RequestBody LoginInfo loginInfo) {
        return userService.loginWeiXinApp(loginInfo);
    }


}
